﻿using System.Collections.Generic;
using AspectsSample.DataContracts;

namespace AspectsSample.Repositories
{
    internal class ChannelConfigRepository
    {
        internal ChannelModel Get()
        {
            int id = 1;

            ChannelRepository channelRepository = new ChannelRepository();
            var channel = channelRepository.GetChannel(id);

            LanguageRepository languageRepository = new LanguageRepository();
            var language = languageRepository.GetLanguage(channel.LanguageId);

            return new ChannelModel
            {
                Id = channel.Id,
                Name = channel.Name,
                Languages = new List<LanguageModel>
                {
                    new LanguageModel { Name = language.Name, Id = language.Id, Locale = language.Locale }
                }
            };
        }
    }
}
